﻿<!DOCTYPE html>
<html>
<head>
    <title>修改密码</title>
    <link href="jquery.mobile-1.3.2.css" rel="stylesheet" type="text/css" />
    <script src="jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="jquery.mobile-1.3.2.js" type="text/javascript"></script>
    <script src="Micro-Website.js" type="text/javascript"></script>
    <script src="klass.min.js" type="text/javascript"></script>
    <script src="code.photoswipe-3.0.5.min.js" type="text/javascript"></script>
    <script src="mobiscroll.custom-2.5.0.min.js" type="text/javascript"></script>
    <script src="xxl.base.js" type="text/javascript"></script>
</head>
<body>
    <div>
        <section data-role="page" data-theme="b" id="gooddetail_main">
            <div style="padding:5px;" id="gooddetail_content">
                <fieldset data-role="controlgroup">
                    <legend>
                        <img src="images/MemInformation.png" alt="" />
	               	    会员密码修改
                    </legend>
                    <% if(!emptypsw){ %>
                       <label for="txtspsw">原密码</label>
                    <input type="password" id="txtspsw" placeholder="请输入原密码" maxlength="16"  name="txtspsw"/>
                    <%} %>
                     <label for="txtnewspsw">新密码</label>
                    <input type="password" id="txtnewspsw" placeholder="请输入新密码" maxlength="16"  name="txtdnewspsw"/>
                    <label for="txtdnewspsw">新密码确认</label>
                    <input type="password" id="txtdnewspsw" placeholder="请再次输入新密码"  maxlength="16" name="txtdnewspsw"/>
                    <label for="randomcode">验证码</label>
                    <table>
                        <tr>
                            <td>
                             <input type="text" id="randomcode" placeholder="请输入右侧的图片验证码"  name="randomcode" maxlength="4"/>
                            </td>
                            <td>
                                <a href="javascript:void(0);" onclick="javascript:Login_ChangeValImg();">
                                    <img id="Login_ValImg" style="height: 30px; width: 90px; border: 0" alt="" src="../Service/ValidateImage.ashx?c=<%=new Random().Next(100000,999999) %>"  title="看不清？换一个" align="top" />
                                </a>
                            </td>
                            <td><a href="javascript:void(0);" onclick="javascript:Login_ChangeValImg();" >刷新<BR />图形</a></td>
                        </tr>
                    </table>     
                <a data-role="button" data-theme="b" id="subimtpsw" onclick='pswsubimt();'>确定修改</a>                 
                </fieldset>
                    <script type="text/javascript">var cmemid = getCookie("uid");if (!(/^\d+$/).test(cmemid)) {loader(true, '您还未登录');setTimeout('loader(false);location.href = "index.aspx";', 500);}function pswsubimt() {var s_psw = $("#txtspsw").val();var n_psw = $("#txtnewspsw").val();var dn_psw = $("#txtdnewspsw").val();var rcode = $.trim($("#randomcode").val());if (rcode.length < 4) {loader(true, '请输入四位验证码');setTimeout('loader(false)', 1500);return;}<% if(!emptypsw){ %>if ($.trim(s_psw).length == 0) {loader(true, '请输入原密码');setTimeout('loader(false)', 1500);return;}<%}%>if ($.trim(n_psw).length == 0) {loader(true, '请输入新密码');setTimeout('loader(false)', 1500);return;}if ($.trim(dn_psw).length == 0) {loader(true, '请再次输入新密码');setTimeout('loader(false)', 1500);return;}if (n_psw == s_psw) {loader(true, '原密码与新密码一致');setTimeout('loader(false)', 1500);return;}if (n_psw != dn_psw) {loader(true, '两次输入的密码不一致');setTimeout('loader(false)', 1500);return;}$.get("../Service/AjaxService.ashx?Method=Change_Pwd",{"uid": getCookie("uid"),"spwd": s_psw,"npwd": n_psw,"dnpwd": dn_psw,"rcode": rcode},function (text) {switch (text) {case "-1":loader(true, '原密码错误');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-2":loader(true, '原密码与新密码一致');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-3":loader(true, '两次输入的密码不一致');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-4":loader(true, '系统错误请重新提交');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-5":loader(true, '请先获取验证码');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-6":loader(true, '验证码已失效');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-7":loader(true, '验证码输入异常');setTimeout('loader(false);ChangeValImg();', 1500);break;case "-8":loader(true, '验证码输入错误');setTimeout('loader(false);ChangeValImg();', 1500);break; case "-9":loader(true, '帐号可能已经被锁定，请联系管理员');setTimeout('delCookie("uid");loader(false);location.href = "login.aspx";', 3000);break;default:loader(true, '修改密码成功,请重新登录');setTimeout('delCookie("uid");loader(false);location.href = "login.aspx";', 2000);}}, "text");}function ChangeValImg() {$("#Login_ValImg").attr("src", "../Service/ValidateImage.ashx?" + GetGuid());}function Login_ChangeValImg() {ChangeValImg();setTimeout("Login_ChangeValImg()", 60 * 1000 * 3);}function GetGuid() {var now = new Date();var year = now.getFullYear();var month = now.getMonth();var date = now.getDate();var day = now.getDay();var hour = now.getHours();var minu = now.getMinutes();var sec = now.getSeconds();var mill = now.getMilliseconds();month = month + 1;if (month < 10) month = "0" + month;if (date < 10) date = "0" + date;if (hour < 10) hour = "0" + hour;if (minu < 10) minu = "0" + minu;if (sec < 10) sec = "0" + sec;var guid = month + date + hour + minu + sec + mill;return guid;}</script>            
            </div>
            <footer data-role="footer" data-position="fixed" id="membershipcard_footer">
                <div data-role="navbar" id="nav-glyphish-example">
                    <ul>
                        <li><a href="#index" data-icon="custom" id="site">商家网站</a></li>
                        <li><a href="#goodlist" data-load="goodlist.aspx" data-icon="custom" id="buy">商品购买</a></li>
                        <li><a href="#membershipcard" data-icon="custom"  id="card" class="ui-btn-active">会员卡</a></li>
                        <li><a href="#giftlist" data-load="giftlist.aspx" data-icon="custom" id="convert">积分兑换</a></li>
                    </ul>
                </div>
            </footer>
        </section>
    </div>
</body>
</html>

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="changepsw.aspx.cs" Inherits="changepsw" %>

